<script type="application/javascript">
var _siteUrl = '<?php echo  Yii::app()->params['siteUrl']?>';
</script>
<?php
/* @var $this HecUserController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'Hec Users',
);

$this->menu=array(
	array('label'=>'Create HecUser', 'url'=>array('create')),
	array('label'=>'Manage HecUser', 'url'=>array('admin')),
);


Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/global/js/pages/adminUser.js");
?>

<span class="page_h3">元素信息</span>

<div style="padding:3px;">
    <table class="s_table">
        <tr>
            <td width="200" >中文名、邮箱、工号：</td>
            <td ><input name="s_username" value="<?php echo $search['s_username'];?>" id="s_username" class="small_input"  /></td>
        </tr>
        <tr>
            <td>部门：</td>
            <td>
            <?php  echo CHtml::dropDownList('s_department' ,$search['s_department'] ,$departmentOption ,array('class'=>'mid_select2')); ?>
            </td>
        </tr>
        <tr>
            <td>CODE：</td>
            <td>
            <?php  echo CHtml::dropDownList('s_code' , $search['s_code'] ,$codeOption ,array('class'=>'mid_select2')); ?>
            </td>
        </tr>
        <tr>
            <td>公司：</td>
            <td>
            <?php  echo CHtml::dropDownList('s_company' ,$search['s_company'] ,$companyOption ,array('class'=>'mid_select2')); ?>
            </td>
        </tr>
        <tr>
            <td> 状态：</td>
            <td>
            <?php  echo CHtml::dropDownList('s_status' ,$search['s_status'] ,$statusOption ,array('class'=>'mid_select2')); ?>
            </td>
        </tr>
        <tr>
            <td>
            
            </td>
            <td colspan="2">
                <input type="button"  value="Search" class="c_button" id="search_user" /> 
                <input type="button"  value="Export" class="c_button" id="export_user" />
            </td>
        </tr>
    </table>
</div>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'user-grid-view',
    'dataProvider'=>$dataProvider,
	//'filter'=>$model,
	'columns'=>array( 
		'id',
		array(
			'name'=>'中文名',
			'value'=> '$data->c_username'
		),
		array(
			'name'=>'工号',
			'value'=>'$data->unique_id'
		), 
		
		array(
			'name'=>'邮箱',
			'value'=> '$data->username'
		),
		array(
			'name'=>'部门',
			'value'=> 'UserDepartment::getInfoById($data->department,"name")'
		),
		array(
			'name'=>'BU',
			'value'=> 'UserDepartment::getInfoById($data->bu,"name")'
		),
		array(
			'name'=>'成本中心',
			'value'=> 'UserCode::getInfoById($data->code,"name")'
		),
		array(
			'name'=>'公司',
			'value'=> 'HecUser::getCompanyName($data->company)'
		),
		array(
			'name'=>'职位类别',
			'value'=> 'HecUser::getAttributeName($data->attribute)'
		),
		array(
			'name'=>'属性',
			'value'=> '$data->position'
		),
		
		array(            // display a column with "view", "update" and "delete" buttons
            'class'=>'CButtonColumn',
			'template'=>'{update}{detail}',
			'buttons'=>array(
				'update' => array(
						'label'=>'修改',     // text label of the button
						'url'=>'Yii::app()->controller->createUrl("hecUser/update",array("id"=>$data->primaryKey))',       // a PHP expression for generating the URL of the button
						'imageUrl'=>Yii::app()->request->baseUrl.'/global/img/icons/page_white_edit.png',  // image URL of the button. If not set or false, a text link is used
						'options'=>array('style'=>'cursor:pointer;',"target"=>"_blank"), // HTML options for the button tag
						'visible'=>'true',
				),
				'detail' => array(
						'label'=>'详情',     // text label of the button
						'url'=>'Yii::app()->controller->createUrl("hecUser/detail",array("id"=>$data->primaryKey))',       // a PHP expression for generating the URL of the button
						'imageUrl'=>Yii::app()->request->baseUrl.'/global/img/icons/magnifier.png',  // image URL of the button. If not set or false, a text link is used
						'options'=>array('style'=>'cursor:pointer;',"target"=>"_blank"), // HTML options for the button tag
						'visible'=>'true',
				),
            ),
			
        ),
		), 
		
));
?>
